<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>

        var book = {
            name:"妙味修炼之道",
            picture:{
                small:'../这是小的',
                middle:'../这是中等的',
                large:'../这是大的',
            },
            fun:function(){

            }
        }
        /*
        
            Object.assign (target,...sources)	

            target:目标对象
            ...sources：原对象
        */

        // var a = {
        //     a:1
        // }
        // var b = {
        //     b:2
        // }
        // var c = {
        //     b:10
        // }

        // var d = Object.assign({},a,b,c);
        // console.log(d)
        /*
            assign 会改变目标对象
        */



        // var obj = Object.assign({},book);


        // book.name = 'css'
        // book.picture.small = '这是大的'
        // console.log(obj)



        var obj = JSON.parse(JSON.stringify(book));

        book.name = 'css'
        book.picture.small = '这是大的'
        console.log(book,obj)


    </script>
</body>
</html>